var app = getApp();

Page({
  data: {
    curHdIndex: 0,
    isfull: !1,
    qyshow: !0,
    nzshow: !0,
    pxshow: !0,
    provinceList: [],
    cityList: [],
    codeData: [],
    hospitalList: [],
    provinceName: "",
    regionName: "区域",
    sectionName: "科室",
    hospitalName: "医院名称",
    cityIndex: null,
    provinceIndex: null,
    sectionIndex: null,
    hospitalIndex: null,
    moreBoo: !0,
    loadingBoo: !0,
    currentResult: 1,
    id: 1,
    jobType: 3,
    doctors: [],
    noDataBoo: !1,
    url: "team/sign/search",
    keyWord: "",
    tablistIndex: 0,
    tabshow: !0,
    tabshow1: !1,
    doctors: [
    ]
  },
  tapFun1: function (t) {
    var o = this;
    console.log(t.target.dataset.current)
    this.setData({
      tablistIndex: t.target.dataset.current
    })
    if (t.target.dataset.current == 1) {
      this.setData({
        tabshow: !0,
        tabshow1: !1,
        currentResult: 1
      })
    }
    if (t.target.dataset.current == 0) {
      this.setData({
        tabshow: !1,
        tabshow1: !0,
        currentResult: 1
      })
    }
    o.searchSome(o)
  },
  scanCode: function () {
    console.log(1111), wx.scanCode({
      success: function (t) {
        console.log(t), "scanCode:ok" == t.errMsg && (console.log(t), wx.navigateTo({
          url: "/hyb_yl/backstageTeam/pages/teamIntro/teamIntro?teamId=" + t.result
        }));
      }
    });
  },
  changeInput: function (t) {
    var o = this,
      a = t.detail.value;
    console.log(a), this.setData({
      currentResult: 1,
      doctors: [],
      moreBoo: !0
    }), this.setData({
      keyWord: a
    }), console.log(a), a.length || o.searchSome(o);
  },
  searchSomeOne: function () {
    var t = this;
    this.setData({
      currentResult: 1,
      moreBoo: !0,
      loadingBoo: !0
    }), t.searchSome(t);
  },
  getMore: function () {
    var t = this;
    t.data.loadingBoo && !t.data.moreBoo || t.data.loadingBoo && (this.setData({
      loadingBoo: !1
    }), t.searchSome(t));
  },
  onLoad: function () {
    var o = this;
    o.searchSome(o)
  },
  searchSome: function (o) {
    var that = this
    o.setData({
      noDataBoo: !1
    });
    o.data.regionName;
    var a = o.data.sectionName,
      e = o.data.hospitalName,
      s = o.data.doctors,
      n = o.data.currentResult,
      r = o.data.tablistIndex;
    "科室" != a && "所有科室" != a || (a = ""), "医院名称" != e && "所有医院" != e || (e = ""), "全国" != o.data.regionName && "区域" != o.data.regionName || ("")
    //查询所有科室
    app.util.request({
      'url': 'entry/wxapp/Yaoqing.allteam',
      data: {
        teamtype: r
      },
      success: function (res) {
        console.log(res)
        that.setData({
          doctors: res.data
        })
      },
    })
  }
});